import serverApiMockUtils from '../utils/serverApiMockUtils'
import Mock from 'mockjs'
import SmsSupplierResponse from '@/core/sms/types/model/response/SmsSupplierResponse'
import SmsSupplierTypeEnum from '@/core/sms/enums/SmsSupplierTypeEnum'
import { MockMethod } from 'vite-plugin-mock'
import mockProdServerUtils from '../utils/mockUtils'
import smsAdminApiConfig from '@/core/sms/generated/apiconfig/smsAdminApiConfig'

const content: SmsSupplierResponse[] = []
for (let i = 0; i < 10; i++) {
	content.push({
		id: i.toString(),
		title: `title_短信供应商_${i.toString()}`,
		remark: Mock.Random.integer(1, 2) == 1 ? null : `remark_短信供应商_${i.toString()}`,
		type: [SmsSupplierTypeEnum.ALIYUN, SmsSupplierTypeEnum.TEST][Mock.Random.integer(0, 2 - 1)].getCode(),
		config: `config_短信供应商_${i.toString()}`,
		deleteFlag: '0',
		createTime: new Date().getTime().toString(),
		updateTime: new Date().getTime().toString(),
		rowVersion: 1,
	} as SmsSupplierResponse)
}

const mockList = [...serverApiMockUtils.getDefaultServerApi(smsAdminApiConfig.smsSendRecord, content)] as MockMethod[]

mockProdServerUtils.addPriorityMockList(1, ...mockList)
